# -*- coding:utf8 -*-
import datetime
from django.db import models
from wanplus.models import BaseModel

__author__ = 'Forcs'

class OttProgram(BaseModel):
    """
    节目信息
    """
    code = models.CharField(max_length=30, null=False, default='', unique=True)  # 编码
    token = models.CharField(max_length=32, null=False, default='', unique=True)  # 标识
    title = models.CharField(max_length=30, null=False, default='')  # 标题
    date_added = models.DateTimeField(null=False, auto_now_add=True)  # 创建时间
    date_last = models.DateTimeField(null=False, auto_now=True)  # 最近修改时间
    bgm = models.CharField(max_length=32, null=False, default='')  # 背景音乐标识
    media = models.CharField(max_length=32, null=False, default='')  # 视频标识
    cover_n_hd = models.CharField(max_length=32, null=False, default='')        # 720p的正常状态封面
    cover_h_fg_hd = models.CharField(max_length=32, null=False, default='')     # 720p的高亮状态封面前景
    cover_h_bg_hd = models.CharField(max_length=32, null=False, default='')     # 720p的高亮状态封面背景
    cover_n_fhd = models.CharField(max_length=32, null=False, default='')       # 1080p的正常状态封面
    cover_h_fg_fhd = models.CharField(max_length=32, null=False, default='')    # 1080p的高亮状态封面前景
    cover_h_bg_fhd = models.CharField(max_length=32, null=False, default='')    # 1080p的高亮状态封面背景
    wrp_url = models.URLField(null=False, default='')  # 资源包CDN地址
    sync_state = models.PositiveSmallIntegerField(null=False, default=0)  # 同步状态
    is_invalid = models.BooleanField(null=False, default=False)  # 是否删除

class ProgramResource(BaseModel):
    """
    节目资源
    """
    program_token = models.CharField(max_length=32, null=False, default='')  # 标识
    name = models.CharField(max_length=64, null=False, default='')  # 文件名
    local_path = models.CharField(max_length=256, null=False, default='')  # 本地路径
    token = models.CharField(max_length=32, null=False, default='', unique=True)  # 资源唯一标识
    is_invalid = models.BooleanField(null=False, default=False)  # 是否删除
